package com.fang.study;

import com.fang.study.pojo.User;
import com.fang.study.context.MyClassPathXmlApplicationContext;
import org.springframework.context.ApplicationContext;

/**
 * @author fanglingxiao
 * @version 1.0
 * @description TODO
 * @date 2021/12/26 7:46 下午
 **/
public class Test03_MyClassPathXmlApplicationContext {
    public static void main(String[] args) {
        ApplicationContext context = new MyClassPathXmlApplicationContext("spring.xml");
        User user = context.getBean("user", User.class);
        user.setName(context.getEnvironment().getRequiredProperty("user.name"));
        System.out.println(user.toString());
    }
}
